package com.bw;

import com.bw.service.CourseRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StockController {
    @Autowired
    private CourseRepository repository;

    @RequestMapping("/updateStock")
    public boolean updateStock(@RequestParam int id, @RequestParam int qty){
        int u = repository.updateStock(id,qty);
        return u==1;
    }
}
